<template>
<div>
    <div style="margin: bottom 30px;">
<h1>添加汽车品牌</h1>
    </div>
<div>
    <div>汽车品牌名称:</div>
    <el-input v-model="input" placeholder="请输入内容" style="width:300px"></el-input>
</div>
<div>
    <el-button type="primary" plain @click="submit">提交</el-button>
    <el-button plain>取消</el-button>
</div>
</div>
</template>

<script>
  export default {
   

    data() {
      return {
         input:""
        }
      },
    
    methods: {
      submit (){
        if(this.input==""){
              this.$message.error('请输入汽车品牌名称');
        }else{
            this.$router.push("/content/carbrand");
            this.addCar(this.input)
            this.getInit();
        }

      },
      addCar(type){
  let Response
  this.$http({
    url: "/automobileBrand/insert",
    method: "POST",
    data: {
      "id": 0,
      "name": type
    }
  })
    .then((res) => {
      Response = res
      console.log('查询Car', res)
    })
    .catch((err) => {
      console.log('订单来源数据获取失败', err)
    })
  return Response
}
    }
  }

</script>